#ifndef __AXES_MOVE_
#define __AXES_MOVE_

#include "Headers.h"

class AxeMove : public RenderTargetListener
{
public:
	AxeMove();
	~AxeMove();

protected:
	// Member variables
	SceneManager *m_pSceneMgr;
	bool m_enabled;
	RenderLayer m_layer;

	ManualObject *m_pGrid;
	bool m_created;
	SceneNode *m_pNode;

	ColourValue m_colour1, m_colour2;
	unsigned int m_division;
	Real m_perspSize;
	bool m_renderScale, m_renderMiniAxes;

public:
	// Constructors and destructor
	ViewportGrid(SceneManager *pSceneMgr, Viewport *pViewport);
	virtual ~ViewportGrid();

	//! Grid colour
	const ColourValue &getColour() const { return m_colour1; }
	void setColour(const ColourValue &colour);

	//! Grid render layer (behind of in front of the objects).
	RenderLayer getRenderLayer() const { return m_layer; }
	void setRenderLayer(RenderLayer layer);

	// Enable / disable
	bool isEnabled() const;
	void enable();
	void disable();
	void toggle();
	void setEnabled(bool enabled);

	// Other functions
	void forceUpdate() { m_forceUpdate = true; }

protected:
	// RenderTargetListener
	void preViewportUpdate(const RenderTargetViewportEvent &evt);
	void postViewportUpdate(const RenderTargetViewportEvent &evt);

	// Other protected functions
	void createAxe();
	void destroyAxe();

	void update();
};

#endif